package com.hpsk.webSocket.model.ai.controller;

import cn.dev33.satoken.stp.StpUtil;
import com.hpsk.common.RespResult;
import com.hpsk.common.RespUtils;
import com.hpsk.webSocket.model.ai.service.IBizAiMessageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户消息体 前端控制器
 * </p>
 *
 * @author huangwang
 * @since 2025-05-20
 */
@RestController
@RequestMapping("/bizAiMessage")
@Tag(name = "ai聊天消息体控制器")
@AllArgsConstructor(onConstructor_ = @__(@Autowired))
public class BizAiMessageController {

    private IBizAiMessageService bizAiMessageService;

    @GetMapping("/delete/{messageId}")
    @Operation(summary = "删除消息")
    public RespResult<Boolean> deleteById(@PathVariable("messageId") Long messageId) {
        String userId = StpUtil.getLoginIdAsString();
        return RespUtils.ok(bizAiMessageService.deleteById(messageId, userId));
    }

}
